/* Copyright (C) 2021 changwei@iscas.ac.cn
 * 
 * Apache License Version 2.0许可头：
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
<template>
  <div>
    <el-table
      v-bind:data="
        dataSource.slice((currentPage - 1) * pagesize, currentPage * pagesize)
      "
      :header-cell-style="{textAlign: 'center'}"
      height="800"
      style="width: 100%"
      highlight-current-row
      :cell-style="{ textAlign: 'center' }"
      @selection-change="handleSelectionChange"
    >
      <el-table-column prop="organization" label="企业组织名称" width="150">
      </el-table-column>

      <el-table-column prop="postfix" label="邮箱后缀" width="150">
      </el-table-column>

      <el-table-column prop="pr" label="OpenHarmony代码贡献" width="150">
        <el-table-column prop="add_oh" label="增加行数" sortable> </el-table-column>
        <el-table-column prop="del_oh" label="删减行数" sortable> </el-table-column>
      </el-table-column>

      <el-table-column prop="pr" label="OpenHarmony-SIG代码贡献" width="150">
        <el-table-column prop="add_sig" label="增加行数" sortable> </el-table-column>
        <el-table-column prop="del_sig" label="删减行数" sortable> </el-table-column>
      </el-table-column>


    </el-table>
    <div style="text-align: center; margin-top: 30px">
      <el-pagination
        background
        layout="prev, pager, next"
        v-bind:total="dataSource.length"
        @current-change="current_change"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    dataSource: "Array",
  },
  data() {
    return {
      pagesize: 1000,
      currentPage: 1,
    };
  },
  computed: {
    pagedTableData() {
      return this.tableData.slice(
        this.pageSize * this.page - this.pageSize,
        this.pageSize * this.page
      );
    },
  },
  methods: {
    current_change: function (currentPage) {
      this.currentPage = currentPage;
    },
  },
};
</script>
<style>
.my-label {
  background: #e1f3d8;
}

.my-content {
  background: #fde2e2;
}
</style>
